package com.dmagic.cms.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Where;

import com.dmagic.cms.common.Constants;
import com.dmagic.cms.common.entity.ModifyInfoEntity;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name = "dmagic_permission")
@Where(clause = ModifyInfoEntity.ISOBSOLETE_DATE_IS_NULL)
@JsonAutoDetect
@JsonIgnoreProperties(value = { "createdBy", "createdOn", "modifiedBy", "modifiedOn", "isObsoleteDate" })
public class Permission extends ModifyInfoEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1279637612730148401L;

	private Long permissionId;

	private String permissionName;

	private String permissionDesc;

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = Constants.ID_GENERATOR)
	@TableGenerator(name = Constants.ID_GENERATOR, // Generator Name which same
													// with
	// generator
	table = Constants.ID_GENERATOR, // Generator Table Name
	pkColumnName = Constants.PK_COLUMNNAME, // Generator Table column Id name
	valueColumnName = Constants.VALUE_COLUMN_NAME, // Generator Table column Id
													// value
	pkColumnValue = "Permission", // entity Name
	allocationSize = (Constants.ID_GENERATOR_ALLLCATIONSIZE), initialValue = Constants.ID_GENERATOR_INITIALVALUE)
	public Long getPermissionId() {
		return permissionId;
	}

	public void setPermissionId(Long permissionId) {
		this.permissionId = permissionId;
	}

	public String getPermissionName() {
		return permissionName;
	}

	public void setPermissionName(String permissionName) {
		this.permissionName = permissionName;
	}

	public String getPermissionDesc() {
		return permissionDesc;
	}

	public void setPermissionDesc(String permissionDesc) {
		this.permissionDesc = permissionDesc;
	}
}
